package com.fengye.japidocs.controller;

import com.fengye.japidocs.dto.UserForm;
import com.fengye.japidocs.dto.UserListForm;
import com.fengye.japidocs.response.ApiResult;
import com.fengye.japidocs.response.PageResult;
import com.fengye.japidocs.vo.UserVO;
import org.springframework.web.bind.annotation.*;

/**
 * User API
 */
@RequestMapping("/api/user/")
@RestController
public class UserController {


    /**
     * 分页
     * @param listForm user分页请求参数
     */
    @RequestMapping(path = "list", method = {RequestMethod.GET,  RequestMethod.POST}  )
    public ApiResult<PageResult<UserVO>> list(UserListForm listForm){
        return null;
    }

    /**
     * 保存用户
     * @param userForm user对象
     */
    @PostMapping(path = "save")
    public ApiResult<UserVO> saveUser(@RequestBody UserForm userForm){
        return null;
    }

    /**
     * 删除用户
     * @param userId user id
     */
    @PostMapping("delete")
    public ApiResult<Void> deleteUser(@RequestParam Long userId){
        return null;
    }

    /**
     * 测试接口
     * @param userId 用户id
     * @return 结果
     */
    @PostMapping("delete")
    public String test(@RequestParam Long userId){
        return "success";
    }
}